package com.education.expenses.entity;

import org.hibernate.annotations.ForeignKey;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import java.util.Date;

/**
 * User: Егор
 * Date: 03.08.12
 * Time: 12:58
 */
@Entity
@Table(name = "receipt")
public class Receipt extends BaseEntity {

    @Enumerated(EnumType.STRING)
    private Description description;

    @Column(name = "by_cash")
    private Boolean byCash;

    @Column(name = "paid_to")
    private String paidTo;

    @Temporal(TemporalType.DATE)
    private Date date;

    private Long meals;

    private Long lodging;

    private Long personal;

    private Long transportation;

    private Long misc;

    @ManyToOne(fetch = FetchType.LAZY)
    @ForeignKey(name = "FK_REPORT_RECEIPTS")
    @JoinColumn(name = "report_id")
    private Report report;

    public Description getDescription() {
        return description;
    }

    public void setDescription(Description description) {
        this.description = description;
    }

    public Boolean getByCash() {
        return byCash;
    }

    public void setByCash(Boolean byCash) {
        this.byCash = byCash;
    }

    public String getPaidTo() {
        return paidTo;
    }

    public void setPaidTo(String paidTo) {
        this.paidTo = paidTo;
    }

    public Long getMeals() {
        return meals;
    }

    public void setMeals(Long meals) {
        this.meals = meals;
    }

    public Long getLodging() {
        return lodging;
    }

    public void setLodging(Long lodging) {
        this.lodging = lodging;
    }

    public Long getPersonal() {
        return personal;
    }

    public void setPersonal(Long personal) {
        this.personal = personal;
    }

    public Long getTransportation() {
        return transportation;
    }

    public void setTransportation(Long transportation) {
        this.transportation = transportation;
    }

    public Long getMisc() {
        return misc;
    }

    public void setMisc(Long misc) {
        this.misc = misc;
    }


    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public Report getReport() {
        return report;
    }

    public void setReport(Report report) {
        this.report = report;
    }
}
